package ui;

import java.awt.Frame;
import java.awt.GridLayout;

import javax.swing.BorderFactory;
import javax.swing.JPanel;
import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;

import com.wolfram.jlink.KernelLink;
import com.wolfram.jlink.MathGraphicsJPanel;

import swing2swt.layout.BorderLayout;
import util.MathUtil;

public class ssss extends Composite {
	private Text text;
	private JPanel jGraphsPanel = null;
	static KernelLink ml;
	/**
	 * Create the composite
	 * @param parent
	 * @param style
	 */
	public ssss(Composite parent, int style) {
		super(parent, style);
		ml = MathUtil.getKernelLink();
		setLayout(new BorderLayout(0, 0));

		final Composite composite = new Composite(this, SWT.NONE);
		composite.setLayoutData(BorderLayout.NORTH);

		final Button analysisButton = new Button(composite, SWT.NONE);
		analysisButton.setText("Analysis");
		analysisButton.setBounds(0, 0, 51, 23);

		final Button typesetButton = new Button(composite, SWT.CHECK);
		typesetButton.setText("TypeSet");
		typesetButton.setBounds(69, 3, 61, 16);

		final Label colNumLabel = new Label(composite, SWT.NONE);
		colNumLabel.setText("Col Num:");
		colNumLabel.setBounds(136, 5, 43, 13);

		text = new Text(composite, SWT.BORDER);
		text.setBounds(185, 2, 30, 17);

		final Composite composite_1 = new Composite(this, SWT.EMBEDDED);
		composite_1.setLayout(new FillLayout());
		composite_1.setLayoutData(BorderLayout.CENTER);

		final Frame frame = SWT_AWT.new_Frame(composite_1);
		frame.setLayout(new GridLayout(1, 0));

		frame.add(getJGraphsPanel());
		//
	}
	private JPanel getJGraphsPanel() {
		if (jGraphsPanel == null) {
			jGraphsPanel = new MathGraphicsJPanel(ml);
			jGraphsPanel.setLayout(new GridLayout(1, 0));
			jGraphsPanel.setBorder(BorderFactory
					.createTitledBorder(""));
		}
		return jGraphsPanel;
	}
	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}

}
